#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Socket Option Exception Class
 *      Represents the exception that occurs when an invalid socket option level and name
 * are specified.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
#include "SafeSocketHandle.h"

using namespace System;
using namespace System::Net;
using namespace System::Net::Sockets;
using namespace System::ComponentModel;

namespace Adaptive
{
	namespace Network
	{
		namespace Sockets
		{
			/// <summary>
			/// Represents the exception that occurs when an invalid socket option level and name
			/// are specified.
			/// </summary>
			public ref class SocketOptionException sealed : public Exception
			{
			public:
				/*--------------------------------------------------------------------------------
				 * Constructor / Dispose / Destructor Methods
				 *------------------------------------------------------------------------------*/
				#pragma region Constructor / Dispose / Destructor Methods
				/// <summary>
				/// Initializes a new instance of the class.
				/// </summary>
				/// <remarks>
				/// This is the default constructor.
				/// </remarks>
				SocketOptionException();
				/// <summary>
				/// Initializes a new instance of the class to the specified erroneous values.
				/// </summary>
				/// <param name="level">
				/// A <see cref="SocketOptionLevel"/> enumerated value indicating the invalid option level that 
				/// was specified, causing the exception.
				/// </param>
				/// <param name="name">
				/// A <see cref="SocketOptionName"/> enumerated value indicating the invalid option name that 
				/// was specified, causing the exception.
				/// </param>
				SocketOptionException(SocketOptionLevel level, SocketOptionName name);
				#pragma endregion

				/*--------------------------------------------------------------------------------
				 * Public Properties
				 *------------------------------------------------------------------------------*/
				#pragma region Public Properties
				/// <summary>
				/// Gets the invalid option level specified.
				/// </summary>
				/// <value>
				/// A <see cref="SocketOptionLevel"/> specified that caused the exception.
				/// </value>
				[Browsable(true), Category("Data"), Description("The invalid socket option level value.")]
				property SocketOptionLevel InvalidLevel { SocketOptionLevel get(); }
				/// <summary>
				/// Gets the invalid option name specified.
				/// </summary>
				/// <value>
				/// A <see cref="SocketOptionName"/> specified that caused the exception.
				/// </value>
				[Browsable(true), Category("Data"), Description("The invalid socket option name value.")]
				property SocketOptionName InvalidName { SocketOptionName get(); }
				#pragma endregion

			private:
				/*--------------------------------------------------------------------------------
				 * Private Member Declarations
				 *------------------------------------------------------------------------------*/
				#pragma region Private Member Declarations
				
				SocketOptionLevel	_invalidLevelValue;
				SocketOptionName	_invalidNameValue;

				#pragma endregion
			};
		}
	}
}